Plex.Lib.JS.load('UI.Button.Hover');
Plex.Lib.CSS.load('UI.Button.Picture');

Plex.UI.Button.Picture = function()
{
	var self = this;
	Plex.S$.extend(this,Plex.UI.Button.Hover)

	//Create
	this.el.pictureTable = new Element('table',{'class':'Picture','cellspacing':0,'cellpadding':0}).injectInside(this.el.body);
	this.el.pictureImgRow = new Element('tr').injectInside(this.el.pictureTable);
	this.el.pictureTextRow = new Element('tr').injectInside(this.el.pictureTable);
	this.el.pictureImgCol = new Element('td',{'class':'Image'}).injectInside(this.el.pictureImgRow);
	this.el.pictureTextCol = new Element('td').injectInside(this.el.pictureTextRow);
	this.el.pictureImg = new Element('img').injectInside(this.el.pictureImgCol);
	this.el.pictureText = new Element('div',{'class':'Text'}).injectInside(this.el.pictureTextCol);
	
	this.el.mainDiv.style.height='145';
	this.el.mainDiv.style.width='145';
	
	this.setTitle = function(newTitle)
	{
		self.title = newTitle;
		self.el.pictureText.setText(newTitle);
	}
	
	this.setImage = function(imageId)
	{
		self.el.pictureImg.src = Plex.Com.Image.getURL(imageId)
	}
	
	this.moveTo = function(parent)
	{
		self.object.injectInside(parent);
	}
}